package com.dailyblue.java.thread;

public class DemoF1 {

    private ThreadLocal<Integer> local = ThreadLocal.withInitial(() -> 1);

    public void change() {
        System.out.println(Thread.currentThread().getName() + "准备对i进行操作，目前i的值是：" + local.get());
        local.set(local.get() + 1);
        System.out.println(Thread.currentThread().getName() + "执行完毕，目前i的值是：" + local.get());
    }
}
